﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wizard.Source;

namespace Wizard.MsSql
{
    partial class ClassSource : IClassSource, IOwnObjects 
    {
        #region IClassSource Members

        IWizardApplication IClassSource.Application
        {
            get { throw new NotImplementedException(); }
        }

        IClassMember IClassSource.AddMember(string memberName, string memberType)
        {
            var newMember = new ClassMember();
            newMember.MemberName = memberName;
            newMember.MemberType = memberType;
            this.ClassMembers.Add(newMember);
            return newMember;
        }

        IMethodSource IClassSource.AddMethod(string methodName)
        {
            var newMethod = new MethodSource();
            newMethod.MethodName = methodName;
            this.MethodSources.Add(newMethod);
            return newMethod;
        }

        IStatementSource IClassSource.GetMethod(string p)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IOwnObjects Members

        void IOwnObjects.DeleteOwnedObjects(DataStoreContext datastore)
        {
            datastore.DeleteObjects(MethodSources);
            datastore.DeleteObjects(ClassMembers);
        }

        int IClassSource.ClassSourceId
        {
            get { return _ClassSourceId; }
        }

        string IClassSource.ClassName
        {
            get { return _ClassName; }
        }

        #endregion
    }
}
